package com.android.monee.data.access.inMemory;

import com.android.monee.data.access.BudgetDao;
import com.android.monee.data.model.Budget;

public class ObservableBudgetDaoInMemory extends AbstractObservableDaoInMemory<Budget, Integer> implements BudgetDao{

	private static ObservableBudgetDaoInMemory instance;
	
	public static ObservableBudgetDaoInMemory getInstance(){
		if(instance == null){
			instance = new ObservableBudgetDaoInMemory();
			instance.init();
		}
		return instance;
	}
	
	protected ObservableBudgetDaoInMemory(){
		super();
	}
	
	protected void init(){
		for(Budget budget : InMemoryMockDatas.getMockBudgetList()){			
			insert(budget);
		}
	}

	@Override
	protected Integer getNextId() {
		return DaoUtils.getNextId(this.datas.values());
	}

}
